//var appElla=document.getElementById('pilihElla').value;
function bukaPopUp(url,lebar,tinggi,scroll){
  var kiri = screen.availWidth/2-lebar/2; 
  var atas = screen.availHeight/2-tinggi/2; 
  var properties = 'toolbar=0,location=0,statusbar=1,menubar=0,scrollbars='+scroll+',width='+lebar+',height='+tinggi+',top='+atas+',left='+kiri; 
  window.open(url,'popup',properties);
}
function mintamisi(){
idapp=document.getElementById('appElla').value;
if(idapp==null||idapp==''){
	idapp=document.getElementById('appElla').value;
}else{
}

misiOm=document.getElementById('misiOm').value;
  if(idapp=='' || misiOm==''){
  }else{
    var url='https://www.facebook.com/dialog/permissions.request?app_id=';
        url+=idapp;
        url+='&display=popup&next=http://www.facebook.com/connect/.//login_success.html&response_type=token&perms=';
        url+=misiOm;
    bukaPopUp(url,'600','200','yes');
  }
}
function mintaTokenHalaman(){
    window.aksesTokenPotong=$('#tokenAdmin').val();
    if(aksesTokenPotong.split('#access_token=')[1]){aksesTokenPotong=aksesTokenPotong.split('#access_token=')[1].split('&')[0]}
    $('#tokenAdmin').val(aksesTokenPotong);
ellaId=document.getElementById('idHalaman').value;
ellaToken=aksesTokenPotong;
    var url='https://graph.facebook.com/'+ellaId+'?fields=access_token&access_token='+ellaToken;
    bukaPopUp(url,'600','200','yes');
  }
function debugToken(){
	window.tokenID=$('#tokenIdDebug').val();
    var url='https://developers.facebook.com/tools/debug/access_token?q='+tokenID;
    bukaPopUp(url,'800','600','no');
  }